package net.hombrecero.bigbeat.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import org.hibernate.annotations.AccessType;

@Entity
@AccessType( "field" )
public class Project extends Base {
  public static final int PROJECTSTATUS_DISABLED        = 1;
  public static final int PROJECTSTATUS_ENABLED_STOPED  = 2;
  public static final int PROJECTSTATUS_ENABLED_RUNNING = 4;



  /* @Id
  @GeneratedValue( generator="system-uuid" )
  @GenericGenerator( name="system-uuid", strategy = "uuid" )
  @Column( length=36 )
  private String uuid;
  public String getUuid(){ return this.uuid; }
  public void setUuid( String uuid ){ this.uuid = uuid; } */
  @OneToMany( targetEntity = App.class, mappedBy = "project" , cascade = { CascadeType.ALL } )
  private Set apps = new HashSet();
  @OneToMany( targetEntity = Driver.class, mappedBy = "project" , cascade = { CascadeType.ALL } )
  private Set drivers = new HashSet();
  @Column( length=32, nullable = false )
  private String name;
  @Column( length=16, nullable = false )
  private String alias;
  @Column( length=256, nullable = false )
  private String description;
  @Column( length=256, nullable = false )
  private String urlWeb;
  @Column( length=256, nullable = false )
  private String urlDoc;
  @Column( length=256, nullable = false )
  private String urlTechDoc;
  @Column( nullable = false )
  private int projectStatus = PROJECTSTATUS_DISABLED;



  public Set getApps() {
    return this.apps;
  }
  public void setApps( Set apps ) {
    this.apps = apps;
  }
  public Set getDrivers() {
    return this.drivers;
  }
  public void setDrivers( Set drivers ) {
    this.drivers = drivers;
  }
  public String getName() {
    return this.name;
  }
  public void setName( String name ) {
    this.name = name;
  }
  public String getAlias() {
    return this.alias;
  }
  public void setAlias( String alias ) {
    this.alias = alias;
  }
  public String getDescription() {
    return this.description;
  }
  public void setDescription( String description ) {
    this.description = description;
  }
  public String getUrlDoc() {
    return this.urlDoc;
  }
  public void setUrlDoc( String urlDoc ) {
    this.urlDoc = urlDoc;
  }
  public String getUrlTechDoc() {
    return this.urlTechDoc;
  }
  public void setUrlTechDoc( String urlTechDoc ) {
    this.urlTechDoc = urlTechDoc;
  }
  public String getUrlWeb() {
    return this.urlWeb;
  }
  public void setUrlWeb( String urlWeb ) {
    this.urlWeb = urlWeb;
  }
  public int getProjectStatus() {
    return this.projectStatus;
  }
  public void setProjectStatus( int projectStatus ) {
    this.projectStatus = projectStatus;
  }
}
